#!/usr/bin/node

const fs=require('fs');

//创建链接

switch(process.argv.length){
  case 4://硬链接 node 13-ln.js src lnk
  {
    let src=process.argv[2],
        lnk=process.argv[3];
    fs.linkSync(src,lnk);
    break; 
  }

  case 5: //软链接 node 13-ls.js -s src lnk
  {
    let src=process.argv[3],
        lnk=process.argv[4];
    fs.symlinkSync(lnk,src);
    break;
  }
  default:
  {
    
    console.error('命令行参数不正确！');
    process.exit(1);    
  }
}
